#import "Enemy.h"
#import "Sprite.h"
@implementation Enemy

	- (void) initPosition {
		x = 320;
		y = 80;
		int y2=240;
        int w=0;
		[head setPosition:x-160 y:y];
		[face setPosition:x-150 y:y+50];  
        w=[body getWidth];
		[body setPosition:x-w y:y2];
		[legs setPosition:x-[legs getWidth] y:y2];
		[feets setPosition:x-[legs getWidth]   y:y2+120];
		[lArm setPosition:x-[lArm getWidth]    y:y2];
		[rArm setPosition:x-80-[rArm getWidth]    y:y2];
		[lFist setPosition:x-[lFist getWidth]	  y:y2];
		[rFist setPosition:x-80-[rFist getWidth]	  y:y2];
		[icon setPosition:x-32 y:2];
		[element setPosition:x-30 y:30];
		[skill setPosition:x-63 y:y];

		x=0;
		y=0;
		activeArm = rArm;
		passiveArm=lArm;
        fist=rFist;
	}

	- (bool ) isEnemy {
		return true;
	}

	- (void) generateCommand {
		int currentCommand;
		//prime serie 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 [1]
		int i = 3;//self.info.aiType;
		switch (i) {
		case 0:
			currentCommand =[self getValueOf:13];
			break;
		case 1:
			currentCommand =[self getValueOf:17];
			break;
		case 2:
			currentCommand =[self getValueOf:19];
			break;
		case 3:
			currentCommand =[self getValueOf:23];
			break;
		case 4:
			currentCommand =[self getValueOf:29];
			break;
		case 5:
			currentCommand =[self getValueOf:31];
			break;
		case 6:
			currentCommand =[self getValueOf:37];
			break;
		case 7:
			currentCommand =[self getValueOf:41];
			break;
		default:
			currentCommand =[self getValueOf:43];
			break;
		}
		//TODO:  nine is ok
		[self setCommand:(currentCommand%3)];
		//[self setCommand:0];
			
	}
@end
